package com.cdream.basic.algorithm.leetcode.array;

import java.util.Arrays;

/**
 * @author cdream
 * @date 10/20/21
 */
public class Question453 {
    public static void main(String[] args) {
        new Question453().minMoves(new int[]{1, 2, 3});
    }

    public int minMoves(int[] nums) {
        int min = Arrays.stream(nums).min().getAsInt();
        int res = 0;
        for (int num : nums) {
            res += (num - min);
        }
        return res;

    }
}
